From cd8fb13cb42085779d1200273f342e6655ca4f54 Mon Sep 17 00:00:00 2001 From: "awilliam@xenbuild.aw" Date: Tue, 5 Dec 2006 13:42:37 -0700 Subject: [PATCH] [IA64] Allocate frame table/mpt table at mfn=0 Allocate frame table/mpt table at mfn=0 even when memory isn't assigned at mfn=0 as work around for transate_domain_pte(). transate_domain_pte() returns mfn=0 when the machine page isn't present as a work around for memory mapped I/O where no device is assigned. Xen might access page_info of mfn=0, so it must be guaranteed that it exists. Otherwise xen panics with a tlb miss fault in xen's virtual address area. Once transate_domain_pte() is fixed correctly, this will be removed. Signed-off-by: Isaku Yamahata --- xen/arch/ia64/xen/xenmem.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/xen/arch/ia64/xen/xenmem.c b/xen/arch/ia64/xen/xenmem.c index c837f0fb4b..8329ecfd6b 100644 --- a/xen/arch/ia64/xen/xenmem.c +++ b/xen/arch/ia64/xen/xenmem.c @@ -181,6 +181,23 @@ void init_virtual_frametable(void) printk("virtual machine to physical table: %p size: %lukB\n" "max_page: 0x%lx\n", mpt_table, ((table_size << PAGE_SHIFT) >> 10), max_page); + + /* + * XXX work around for translate_domain_pte(). + * It returns mfn=0 when the machine page isn't present. This + * behavior is a work around for memory mapped I/O where no device + * is assigned. Xen might access page_info of mfn=0, so it must + * be guaranteed that it exists. Otherwise xen panics with tlb miss + * fault in xen's virtual address area. + * + * Once translate_domain_pte() is fixed correctly, this will + * be removed. + */ + if (!mfn_valid(0)) { + printk("allocating frame table/mpt table at mfn 0.\n"); + create_frametable_page_table(0, PAGE_SIZE, NULL); + create_mpttable_page_table(0, PAGE_SIZE, NULL); + } } int -- 2.30.2